package com.example.consuldemo.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author gaofeng
 */
@Configuration
public class MySelfRule {

    @Bean
    public IRule myRule() {
        /**
         * Ribbon默认的负载均衡策略，如果每台机器的配置一样，不建议修改
         */
        return new RoundRobinRule() ;
    }
}
